package com.zb.api.common.econts;


public enum RoomEnum {
    ONE_BEDROOM(1, "一居室"),
    TWO_BEDROOM(2, "二居室"),
    THREE_BEDROOM(3, "三居室"),
    MORE_THREE_BEDROOMS(4, "三居室+"),
    RETEST(5, "复试"),
    VILLA(6, "别墅"),
    LARGE_SIZED_APARTMENT(7, "小户型"),
    OTHER(8, "其他")
  ;

    private String desc;
    private Integer value;

    RoomEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public String getDesc() {
        return desc;
    }

    public Integer getValue() {
        return value;
    }


    public static RoomEnum valueOf(Integer value) {
        for (RoomEnum statusEnum : values()) {
            if (statusEnum.getValue().equals(value)) {
                return statusEnum;
            }
        }
        throw new RuntimeException("没有找到对应的枚举");
    }

    public static String value (Integer value) {
        for (RoomEnum item : RoomEnum.values()) {
            if (item.getValue().equals(value)) {
                return item.getDesc();
            }
        }
        return null;
    }
}
